<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03_JS数据类型</title>
</head>
<body>
<script>
    var a = 1;
    var b = 3.14;
    console.log(a,typeof a,b,typeof b);
    var c = "hello";
    var d = 'world';
    console.log(c,typeof c,d,typeof d);
    var e = true;
    var f = false;
    console.log(e,typeof e,f,typeof f);
    var g = null;
    console.log(g,typeof g);
    var h;
    console.log(h,typeof h);

    let obj = {};
    obj.name = "张三";
    obj.age = 18;
    console.log(obj,typeof obj);

    let obj2 = {
        name: "张三",
        age: 18
    };
    console.log(obj2,typeof obj2);
    obj2.like = "football";
    console.log(obj2,typeof obj2);
    console.log(obj2.name,obj2.age,obj2.like);

    console.log(obj2.play);

    let arr = [1,2,3.14,"hello",true];
    console.log(arr,typeof arr);
    console.log(arr[0],arr[1],arr[2],arr[3],arr[4]);
    console.log(arr.length);
    console.log(arr[99]);

    console.log(Number(true),typeof Number(true));
    console.log(Number(false));
    console.log(Number('123'));
    console.log(Number(23.5));
    console.log(Number("hhhh"));

    console.log(Boolean(0));
    console.log(Boolean(null));
    console.log(Boolean(undefined));
    console.log(Boolean(NaN));
    console.log(Boolean(''));
    console.log('0 null undefiend NaN 空串 以上五个值转为布尔类型的结果是false!')
    console.log(Boolean(' '));
    console.log(Boolean('hhh'));
    console.log(Boolean(1));








</script>
</body>
</html>